<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: homePath }" @click.native="homeClick"
        >首页</el-breadcrumb-item
      >
      <el-breadcrumb-item>{{ title }}</el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {
  name: "Breadcrumb",
  props: {
    title: {
      type: String,
      default: "",
    },
    homePath: {
      type: String,
      default: "/login",
    },
  },
  methods: {
    homeClick() {
      let type = this.homePath.substr(1) + "CurrentIndex";
      this.$store.commit("setCurrentIndex", {
        type,
        index: -1,
      });
    },
  },
};
</script>

<style lang="less" scoped>
.el-breadcrumb {
  font-size: 16px;
}
</style>